
// 基础类型
let isDone: boolean = true

let age: number = 20

let msg: string = 'hello'


let u: undefined = undefined
let n: null = null

let num: number = undefined // undefined,null 是所有类型的自类型

// any类型
let notSure : any = '124'
notSure = 123
notSure = false

// 联合类型
let numberOrString : number | string = '123'
numberOrString = 23
// numberOrString = false

// 数组
let arrOfNumber : number[] = [1,2,3]
arrOfNumber.push(4)
//arrOfNumber.push('a') error

// 元组
let user : [string,number] = ['lxy',20]
// user = ['lxy',20,1] error
